package com.xli.mybatis.support;

import cn.hutool.crypto.symmetric.SM4;

public class SM4Support implements Encrypt{
    @Override
    public String encrypt(String plainText, String key) {
        SM4 sm4 = new SM4(key.getBytes());
        return sm4.encryptBase64(plainText);
    }

    @Override
    public String decrypt(String cipherText, String key) {
        SM4 sm4 = new SM4(key.getBytes());
        return sm4.decryptStr(cipherText);
    }
}
